import { Pipe, PipeTransform } from '@angular/core';
import {Config} from '../config';
import * as moment from 'moment';

@Pipe({name: 'dateFormat'})
export class DateFormat implements PipeTransform {
    date:string;
    transform(value){
        if(value){
            this.date = moment(value).format('YYYY-MM-DD');
            return this.date;
        }else{
            return '';
        }
        
    }
}